package com.liangzhong.model.match
{
	import flash.utils.ByteArray;

	/**
	 *比赛事件 
	 * @author lxh
	 * 
	 */	
	public class EventDes
	{
		/**
		 *比赛id 
		 */		
		public var matchId		:int;
		public var time 		:int;
		public var eventType 	:int;
		public var numId		:int;
		//json 标志
		public var eventDes		:int = 1;
		
		public function EventDes()
		{
		}
		
		/**
		 * 
		 * @param data
		 * 
		 */		
		public function readData(data : ByteArray):void
		{
			matchId		= data.readUnsignedInt();
			time 		= data.readShort();
			eventType 	= data.readShort();
			numId	 	= data.readInt();
		}
		public function toString():String
		{
			return "{time:" + time + ",matchId:" + matchId + ",eventType:" + eventType + ",numId:" + numId + "}";
		}
		/**
		 *解析记录中数据
		 * @param obj
		 */		
		public function parseHistoryData(obj :Object):void
		{
			for(var str:String in obj)
			{
				if(this.hasOwnProperty(str))
				{
					this[str] = obj[str];
				}
			}
		}
	}
}